<template>
<mytable :config="tableconfig">
  <template  v-slot:age="ndata">
    <span style="color:red">{{ndata.data.age}}</span>
  </template>
</mytable>
</template>

<script>
import mytable from './index.vue'
export default {
  name: 'demo',
  // 局部注册的组件
  components: {mytable},
  // 组件状态值
  data () {
    return {
      tableconfig:{
        tabledata:[
          {name:"zhangsan",age:123,sex:"男"}
        ],
        thead:[
          {label:"姓名",prop:"name",type:"function",
          callback:(row)=>{
            console.log(row,1111111)
              return row.name+"wocao"
          }},
          {label:"年龄",prop:"age",type:"slot",},
          {label:"性别",prop:"sex"},
        ]
      }
    }
  },
  // 计算属性
  computed: {},
  // 组件方法
  methods: {
    sizeChange(){
      console.log(1)
    }
  },
  created () {
  },
  mounted () {
  },
}
</script> 

<style scoped>

</style>